﻿@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>Index</title>
    
    <!--通用css-->
    <link rel="stylesheet" type="text/css" href="~/Content/Site.css">
    <!--960css框架-->
    <link rel="stylesheet" type="text/css" href="~/Content/960/fluid/reset.css">
    <link rel="stylesheet" type="text/css" href="~/Content/960/fluid/text.css">
    <link rel="stylesheet" type="text/css" href="~/Content/960/fluid/grid.css">

    <!--easyuid主题-->
    <link rel="stylesheet" type="text/css" href="~/Content/easyui/themes/default/easyui.css">
    <link rel="stylesheet" type="text/css" href="~/Content/easyui/themes/icon.css">
    <!--加载样式修正CSS-->
    <link rel="stylesheet" type="text/css" href="~/Content/fix.css">
    
    <!--js-->
    <script type="text/javascript" src="~/Scripts/jquery-1.8.2.min.js"></script>
    <script type="text/javascript" src="~/Scripts/easyui/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="~/Scripts/easyui/locale/easyui-lang-zh_CN.js"></script>
    <script>
    
        $(function () {
            //$('#btnSearch').bind('click', function () {
            //    search();
            //});

            $("#dg").datagrid({
                url:"/Customer/Search"
            });

        });

        function s() {
            var u = "/Customer/Search?";
            var name = "";

            if ($("#sName").val()!="") {
                u = u + "name=" + $("#sName").val();
            }

            $("#dg").datagrid({
                    url:u
                }
            );
            $("#dg").datagrid('reload');
        }

        
        function e() {
            var row = $("#dg").datagrid('getSelected');
            if (row) {

                parent.addTab("客商" + row.Id, "/Customer/Detail/" + row.Id);

            } else {
                alert("请先选中一条记录");
            }
        }
    </script>
    
</head>
<body>

    <div class="z-toolbar" style="margin:2px;padding:2px;border:1px solid #ddd;">
        <a href="#" id="btnSearch" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-search'" onclick="s();">查询</a>
        <a href="#" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-redo'">清空</a>
        <a href="#" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-add1'">添加</a>
        <a href="#" id="btnEdit" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-edit'" onclick="e();">编辑</a>
    </div>

    <div id="master" class="container_12">
        <div class="grid_1 lbl">客商名称</div>
        <div class="grid_3 val"><input id="sName" class="z-txt" type="text" /></div>
        <div class="grid_1 lbl">注册地址</div>
        <div class="grid_3 val"><input id="sAddress" class="z-txt" type="text" /></div>
        <div class="grid_1 lbl">注册号</div>
        <div class="grid_3 val"><input id="sRegNo" class="z-txt" type="text" /></div>
        <div class="grid_1 lbl">经营范围</div>
        <div class="grid_3 val"><input id="sBusiness" class="z-txt" type="text" /></div>
        <div class="grid_1 lbl">NC编号</div>
        <div class="grid_3 val"><input id="sNcNum" class="z-txt" type="text" /></div>
        <div class="grid_1 lbl">处理状态</div>
        <div class="grid_3 val"><input id="sStatus" class="z-txt" type="text" /></div>
        <div class="clear"></div>
        <div style="margin-top: 5px; padding: 2px">
            <table id="dg" class="easyui-datagrid" style="height: 440px" pagination="true" rownumbers="true" fitColumns="true" singleSelect="true" pageSize=15>
                <thead>
                    <tr>
                        <th field="Id" width="30">ID</th>
                        <th field="Name" width="200">客商名称</th>
                        <th field="Address" width="200">注册地址</th>
                        <th field="RegNo" width="100">注册号</th>
                        <th field="Business" width="150">经营范围</th>
                        <th field="NcNum" width="100">NC编号</th>
                        <th field="Status" width="100">处理状态</th>
                    </tr>
                </thead>
            </table>
        </div>
    </div>

</body>
</html>